package com.mm.cme.kotlin_001.level01.i_000_basic_type

import com.mm.cme.kotlin_001.utils.pl

/**
 * Descriptions：基本数据类型1
 * 包括Boolean、Int、Long、Float、Double、Short、Byte
 * <p>
 * Author：ChenME
 * Date：2017/7/15
 * Email：ibelieve1210@163.com
 */


val bool_a: Boolean = true
val bool_b: Boolean = false

val int_a: Int = 8
val int_b: Int = 0xff
val int_c: Int = 0b11
val int_max: Int = Int.MAX_VALUE
val int_min: Int = Int.MIN_VALUE

val long_a: Long = 1234342343445453459
val long_b: Long = 123L
val long_max: Long = Long.MAX_VALUE
val long_min: Long = Long.MIN_VALUE

val float_a: Float = 2.0f
val float_b: Float = 1E3f
val float_max: Float = Float.MAX_VALUE
val float_min: Float = Float.MIN_VALUE
val float_max_plus: Float = Float.POSITIVE_INFINITY
val float_min_plus: Float = Float.NEGATIVE_INFINITY
val float_nan: Float = Float.NaN

val double_a: Double = 3.0
val double_b: Double = 3.1415926
val double_max: Double = Double.MAX_VALUE
val double_min: Double = Double.MIN_VALUE

val short_max: Short = Short.MAX_VALUE
val short_min: Short = Short.MIN_VALUE

val byte_max:Byte= Byte.MAX_VALUE
val byte_min:Byte= Byte.MIN_VALUE


fun main(args: Array<String>) {
    pl(int_a)
    pl(int_b)
    pl(int_c)

    pl(int_max)
    pl(Math.pow(2.0, 31.0) - 1)
    pl(int_min)
    pl(Math.pow(-2.0, 31.0) + 1)

    pl(long_max)
    pl(Math.pow(2.0, 63.0) - 1)
    pl(long_min)
    pl(Math.pow(-2.0, 63.0) + 1)

    pl(float_b)
    pl(float_max)
    pl(float_min)
    pl(float_max_plus)
    pl(float_min_plus)
    pl(float_nan)
    pl(0f / 0f)
    pl(0f / 0f == float_nan)

    pl(double_max)
    pl(double_min)

    pl(short_max)
    pl(Math.pow(2.0, 15.0) - 1)
    pl(short_min)

    pl(byte_max)
    pl(byte_min)
}
